<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>Finalove-App-news</title>
		<link rel="stylesheet" href="../../resource/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="../../resource/css/mint.css">
		<link rel="stylesheet" href="../../resource/css/style.css">
		<script src="../../resource/js/vue.js"></script>
		<script src="../../resource/js/mint.min.js"></script>
		<script src="../../resource/js/jquery.min.js"></script>
		<style type="text/css">
			#iframe{
				margin-top: -35px;
			}
			.Mask {
				width: 100%;
				height: 60px;
				position: fixed;
				top: 0;
				z-index: 999;
			}
			.mint-indicator-mask {
				background: #f2f2f2;
				opacity: 1;
				z-index: 9998;
			}
		</style>
	</head>
	<body>
		<div id="main">
			<mt-header fixed :title="title">
				<mt-button icon="back" slot="left" class="closeView"></mt-button>
			</mt-header>
			<div class="Mask"></div>
			<iframe id="iframe" src="" width="100%" height="100%" android:hardwareAccelerated="true"></iframe>
		</div>
	</body>
	<script type="text/javascript">
		var main = new Vue({
			el:"#main",
			data:{
				title:"新闻详情"
			},
			mounted:function() {
				this.init();
			},
			methods:{
				init() {
					// loading
					this.$indicator.open({text:'Loading....',spinnerType: 'double-bounce'});
					document.addEventListener('plusready',function () {
						// 沉浸header
						plus.navigator.setFullscreen(true);
						// header返回btn
						document.querySelector(".closeView").addEventListener('click',function(){
							plus.webview.currentWebview().close();
						});
						// backbutton事件修改
						plus.key.addEventListener('backbutton', function() {
							plus.webview.currentWebview().close();
							return false;
						}, false);
						// 获取参数
						var url = plus.webview.currentWebview().url;
						main.title =  plus.webview.currentWebview().title;
						// iframe
						$("#iframe").attr({src:url});
						$("#iframe").load(function(){  
							main.hideAd();
							var sub_img_arr = $("#iframe")[0].contentWindow.$("img");
							$("#iframe")[0].contentWindow.$("img").on("click",function() {
								var url_arr = [];
								url_arr.push($(this).attr('src'));
								plus.nativeUI.previewImage(url_arr);
								return false;
							});
							
						});
					})
				},
				hideAd() {
					$("#iframe")[0].contentWindow.$("footer").hide();
					$("#iframe")[0].contentWindow.$("section").hide();
					$("#iframe")[0].contentWindow.$(".go_index").hide();
					$("#iframe")[0].contentWindow.$(".doc-footer-wrapper").hide();
					$("#iframe")[0].contentWindow.$(".relative_doc").hide();
					$("#iframe")[0].contentWindow.$(".wakeup_bar").hide();
					$("#iframe")[0].contentWindow.$(".wakeup_desc").hide();
					$("#iframe")[0].contentWindow.$(".hot_news").hide();
					$("#iframe")[0].contentWindow.$(".more-client").hide();
					$("#iframe")[0].contentWindow.$("a").hide();
					$("#iframe")[0].contentWindow.$('.show_article').click();
					$("#iframe")[0].contentWindow.$('.cancel-btn').click();
					$("#iframe")[0].contentWindow.$('.more_up').hide();
					$("#iframe")[0].contentWindow.$('.relative_doc').hide();
					$("#iframe")[0].contentWindow.$('.uc-fixed-ad-wrap').hide();
					setTimeout(() => {
						$("#iframe")[0].contentWindow.$('section').hide();
					},500);
					this.$indicator.close();
				}
			}
		})
	</script>
</html>
